package com.qf.controller;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradePrecreateModel;
import com.alipay.api.request.AlipayTradePrecreateRequest;
import com.alipay.api.response.AlipayTradePrecreateResponse;
import com.qf.Service.AlipayService;
import com.qf.config.AlipayConfig;
import com.qf.entity.Order;
import com.qf.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 作者：大狗
 * 时间：2021/7/13 16:27
 */
@CrossOrigin("*")
@RestController
@RequestMapping("/cost")
public class AlipayController {
    @Autowired
    private AlipayService alipayService;
    @Autowired
    private OrderMapper orderMapper;
    //返回支付宝支付链接
    @GetMapping
    public Object testPay(){
       return alipayService.getPayUrl();
    }
    @PostMapping("/test")
    public Object test(){
        return alipayService.storeData();
    }
    @GetMapping("/a")
    public Object jj(){
        return "sedsgdi hoja";
    }
}
